import request from '/utils/request'

export const currencyApi = {
  /** 充值积分, 返回订单信息 */
  rechargeCurrency(amount: number, openId: string): Promise<RechargeOrderResult> {
    return request.post('/currencyRecharge/orders', {
      type: 'WechatWapOrder',
      amount,
      openId,
      from: 5,
    })
  },

  /** 积分收入支出记录 */
  currencyOrder(payload: any): Promise<any> {
    return request.get('/currency/orders', { params: payload })
  },
  /** 获取钱包余额记录
   * limit	15	string	是
    -
      action	income	string	是
      income: 收入，expenses-支出
      after	0	string	是
    -
   */
  walletIncomeOrder(payload: any): Promise<any> {
    return request.get('/plus-pay/orders', { params: payload })
  },
}
